import React from "react";
import { Swiper, Toast } from "antd-mobile";

const colors = ["#ace0ff", "#bcffbd", "#e4fabd", "#ffcfac"];

// eslint-disable-next-line import/no-anonymous-default-export
export default ({ list }) => {
  return (
    <>
      <Swiper autoplay loop>
        {list.map((item) => (
          <Swiper.Item key={item.id}>
            <div
              style={{ height: "200px" }}
              onClick={() => {
                Toast.show(`你点击了编号 ${item.id}`);
              }}
            >
              <img
                style={{ height: "100%", width: "100%" }}
                src={"/api" + item.advImg}
                alt="描述"
              />
            </div>
          </Swiper.Item>
        ))}
      </Swiper>
    </>
  );
};
